//引入数据库
const db = require('../db/index')

exports.publicMessage = (req, res) => {

    const insertSql = 'insert into pub_index set ?'


    db.query(insertSql, { username: req.user.username, pub_des: req.body.pub_des, pub_img: (req.body.pub_img).toString(), user_url: req.user.user_url }, (err, results) => {
        if (err) return res.cc(err)
            // if (results.length == 0) return res.cc("未有内容，无法发布！")
        res.send({
            status: 0,
            message: "发布成功!"
        })
    })

}